<%= msg if msg!=''-%>
<ul class="mylist">
<% for event in @events -%>
<li id="item_<%=event.id%>">
<b><%= event.date %></b>
<%= event.title %>
(
<% if(event.date != nil) -%>
<% if(event.date == Date.today) -%>
<div class="duetoday">today !</div>
<% elsif(event.date > Date.today and event.date <= Date.today+1) -%>
<div class="duetoday">tomorrow!</div>
<% elsif(event.date > Date.today and event.date <= Date.today+3) -%>
<div class="duenear"><%= time_ago_in_words(event.date+1) %></div>
<% elsif(event.date > Date.today) -%>
<div class="duefutur"><%= time_ago_in_words(event.date+1) %></div>
<% elsif(event.date < Date.today) -%>
<div class="duepast"><%= time_ago_in_words(event.date) + " ago !" %></div>
<% end -%>
<% end -%>
)
<a href="#" onclick="del_event(<%=event.id%>);return false;"><img id="de<%=event.id%>" src="/images/delete.gif" border="0"></a>
</li>
<% end -%>
</ul>

